package com.example.admin;


import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.client.discovery.DiscoveryClient;

@SpringBootTest
public class AppText {

    @Autowired
    private DiscoveryClient discoveryClient;


    @Test
    void discoveryClientText() {
        // 获取服务列表
        for (String serviceName : discoveryClient.getServices()){
            System.out.println("服务名称：" + serviceName);
        }
    }
}
